package com.hy.api;

import com.hy.entitys.Chapter;
import com.hy.entitys.StoryEntity;
import com.hy.service.IStoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value ="/story",tags="小说模块")
@RestController
@RequestMapping("/story")
public class ApiStoryController {

    @Autowired
    public IStoryService storyService;

    @RequestMapping(value = "/chapter",method =RequestMethod.GET)
    @ApiOperation(value = "/chapter",tags ="获取章节列表")
    public List<Chapter> getChapter(String url, Integer webStorageId){
        return storyService.getChapters(url, webStorageId);
    }

    @RequestMapping(value = "/find",method =RequestMethod.GET)
    @ApiOperation(value = "/find",tags ="查询小说")
    public List<StoryEntity> findStory(String name){
        return storyService.findStory(name);
    }


}
